package main

import (
	"MessageSendService/app/common/log"
	"MessageSendService/app/job/etc"
	"MessageSendService/app/job/internal/db"
	"MessageSendService/app/job/internal/handlers"
	"MessageSendService/app/job/internal/service"
	"MessageSendService/app/job/mq"
	"go.uber.org/zap"
)

// var logPath = "./app/job/logs/"
// var yamlPath ="./app/job/job.yml"
var logPath = "./logs/"
var yamlPath = "./job.yml"

func main() {
	//加载配置文件
	etc.LoadConfig(yamlPath)

	//初始化日志
	log.InitLogger(logPath)
	log.GetLogger().Info("fdasf", zap.Bool("asdf", true))

	//注册各种消息类型
	handlers.SetUp()

	//初始化数据库
	db.MysqlConnectInit()

	//初始化账户信息，这个必须在数据库初始化之后
	service.InitAccount()

	//初始化kafka设置，开始消费各种消息
	mq.Init()

}
